#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 110;
int n;
int main()
{
    int f1 = 0, f2 = 0;
    cin >> n;
    while(n --)
    {
        int x1, x2, y1, y2;
        cin >> x1 >> x2 >> y1 >> y2;
        int total = x1 + y1;
        if(x2 == total && y2 != total)
        {
            f2 ++;
        }
        else if(x2 != total && y2 == total)
        {
            f1 ++;
        }
    }
    cout << f1 << ' ' << f2 << endl;
    return 0;
}